package com.slimbloody.client;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping(value = "/call")
@RestController
public class CallController {
  @Autowired
  private CallService callService;

  @Autowired
  private EurekaService eurekaService;

  @Autowired
  private ApplicationContext applicationContext;

  @PostMapping("/callService")
  public String callService(@RequestBody String name) {
    return callService.receiveGreeting(name);
  }

  @PostMapping("/eurekaService")
  public String eurekaService(@RequestBody String name) {
    return eurekaService.receiveGreeting(name);
  }

  @PostMapping("/debug")
  public void debug() {
    System.out.println("123");
    System.out.println("456");
  }
}
